<!DOCTYPE html>
<html>

<head>
    <meta charset="UTF-8">
    <title>工程评价</title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
          content="width=device-width,user-scalable=yes, minimum-scale=0.4, initial-scale=0.8,target-densitydpi=low-dpi"/>
    {CSS href="__ADDONSTATIC__css/font.css" /}
    {CSS href="__ADDONSTATIC__css/xadmin.css" /}
    {js href='__ADDONSTATIC__js/jquery-3.2.1.min.js' /}

    {js href='__ADDONSTATIC__js/xadmin.js' /}
    {js href='__ADDONSTATIC__js/util.js' /}
    <script src="https://cdn.jsdelivr.net/npm/vue"></script>
    {js href='__ADDONSTATIC__lib/layui/layui.js' /}
    <!-- 让IE8/9支持媒体查询，从而兼容栅格 -->
    <!--[if lt IE 9]>
    <script src="https://cdn.staticfile.org/html5shiv/r29/html5.min.js"></script>
    <script src="https://cdn.staticfile.org/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <style>
        .layui-table tr th{
            font-weight: bold;
        }
    </style>
</head>

<body>
<div class="layui-tab layui-tab-card">
    <ul class="layui-tab-title">
        {foreach name="Elist" item="value"}
        {if condition="$value['sId'] < $project['statusId']"}
        <li class="layui-this" style="background-color: #84d945;">{$value['description']}</li>
        {/if}
        {if condition="$value['sId'] == $project['statusId']"}
        <li class="layui-this" style="background-color: #1E9FFF;">{$value['description']}</li>
        {/if}
        {if condition="$value['sId'] > $project['statusId']"}
        <li class="layui-this" style="background-color: #A4A4A4;cursor: not-allowed">{$value['description']}</li>
        {/if}
        {/foreach}
    </ul>
    <div class="layui-tab-content">
        {foreach name="Elist" item="value"}
        {if condition="$value['sId'] <= $project['statusId']"}
        {if condition="$value['sId'] == $project['statusId']"}
        <div class="layui-tab-item layui-show">
            {else /}
            <div class="layui-tab-item">
                {/if}
                <fieldset class="layui-elem-field show">
                    <legend>{$project.name}</legend>
                    <div class="layui-field-box">
                        <table class="layui-table" lay-size="lg">
                            <colgroup>
                                <col width="340px">
                            </colgroup>
                            <tbody>
                            <tr>
                                <th>项目状态：</th>
                                <td>{$value.description}</td>
                            </tr>
                            <tr>
                                <th>施工进度、项目劳动力安排、材料进场方面：</th>
                                <td>{$value.speed ? $value.speed : "未评价"}</td>
                            </tr>
                            <tr>
                                <th>施工质量、现场配合度方面：</th>
                                <td>{$value.quality ? $value.quality : "未评价"}</td>
                            </tr>
                            <tr>
                                <th>安全文明方面：</th>
                                <td>{$value.security ? $value.security : "未评价"}</td>
                            </tr>
                            <tr>
                                <th>备注：</th>
                                <td>{$value.remark ? $value.remark : "未评价"}</td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                </fieldset>
                <div style="text-align: center">
                {if condition="!$value['statusId'] && $value['sId'] < $project['statusId']"}
                <button onclick="sendMessage({$project.id},{$value.sId})" class="layui-btn layui-btn-lg">发送给负责人</button>
                    {else /}<button class="layui-btn layui-btn-lg layui-btn-disabled">发送给负责人</button>
                {/if}
                </div>
            </div>
        {/if}
        {/foreach}
    </div>
</div>

<script>
    //选项卡
    layui.use('element', function () {
        var element = layui.element;
    });

    function sendMessage(projectId,statusId) {
        ajaxUrl("{:addonUrl(Admin/sendEvaluateToMember)}",
                {projectId: projectId,statusId:statusId}, function (data) {
                    layer.alert(data.message,{}, function (index) {
                        layer.close(index);
                        if(data.code == 1){
                            x_admin_close();
                        }
                    });
                })
    }
</script>
</body>

</html>